// InstrumentField
export type InstrumentField = {
	InstrumentID: string
	InstrumentName: string
	ProductID: string
	ExchangeID: string
	PriceTick: number
	VolumeMultiple: number
	UnderlyingInstrID: string
	ProductClass: number
	OptionsType: number
	OpenDate: string
	ExpireDate: string
}

// Bar
export type Bar = {
	DateTime: string
	InstrumentID?: string
	Open: number
	High: number
	Low: number
	Close: number
	Volume: number
	OpenInterest?: number
	MA5?: string | number
	MA10?: string | number
	MA20?: string | number
	MA30?: string | number
	UpDown?: number // 1 -1
}

// 用于 get 数据
// export type GetBar = Pick<KSeries, 'DateTime' | 'InstrumentID' | 'Open' | 'Close' | 'High' | 'Low' | 'Volume' | 'OpenInterest'>

// Account
export type Account = {
	AccountID: string
	Available: number
	Balance: number
	CashIn: number
	CloseProfit: number
	Commission: number
	CurrencyID: string
	CurrMargin: number
	Deposit: number
	ExchangeMargin: number
	FrozenCommission: number
	FrozenMargin: number
	PositionProfit: number
	PreBalance: number
	Reserve: number
	Withdraw: number
	WithdrawQuota: number
}

/**
 * Order
 */
export type Order = {
	AccountID: string
	CancelTime: string
	ClientID: string
	CombHedgeFlag: number
	CombOffsetFlag: number
	CurrencyID: string
	Direction: number
	ExchangeID: string
	FrontID: number
	InsertDate: string
	InsertTime: string
	InstrumentID: string
	InvestorID: string
	InvestUnitID: string
	LastTime: string
	LimitPrice: number
	OrderLocalID: string
	OrderPriceType: number
	OrderRef: string
	OrderStatus: number
	OrderSubmitStatus: number
	OrderSysID: string
	OrderTime: string
	OrderType: number
	RelativeOrderSysID: string
	SessionID: number
	StatusMsg: string
	TimeCondition: number
	TradingDay: string
	UpdateTime: string
	UserForceClose: number
	UserID: string
	UserProductInfo: string
	VolumeCondition: number
	VolumeTotal: number
	VolumeTotalOriginal: number
	VolumeTraded: number
	ZCETotalTradedVolume: number
}
/**
 * Trade
 */
export type Trade = {
	Direction: number
	ExchangeID: string
	HedgeFlag: number
	InsertTime: string
	InstrumentID: string
	InvestorID: string
	InvestUnitID: string
	OffsetFlag: number
	OrderRef: string
	OrderSysID: string
	Price: number
	TradeDate: string
	TradeID: string
	TraderID: string
	TradeTime: string
	TradeType: number
	TradingDay: string
	UpdateTime: string
	UserID: string
	Volume: number
}
/**
 * Position
 */
export type Position = {
	AbandonFrozen: number
	CashIn: number
	CloseAmount: number
	CloseProfit: number
	CloseProfitByDate: number
	CloseProfitByTrade: number
	CloseVolume: number
	Commission: number
	ExchangeID: string
	ExchangeMargin: number
	FrozenCash: number
	FrozenCommission: number
	FrozenMargin: number
	HedgeFlag: number
	InsertTime: string
	InstrumentID: string
	InvestorID: string
	InvestUnitID: string
	LongFrozen: number
	LongFrozenAmount: number
	OpenAmount: number
	OpenCost: number
	OpenVolume: number
	PosiDirection: number
	Position: number
	PositionCost: number
	PositionCostOffset: number
	PositionProfit: number
	ShortFrozen: number
	ShortFrozenAmount: number
	StrikeFrozen: number
	StrikeFrozenAmount: number
	TodayPosition: number
	TradingDay: string
	UpdateTime: string
	UseMargin: number
	YdPosition: number
	YdStrikeFrozen: number
}
/**
 * OrderInsert
 */
export type OrderInsert = {
	Director: string
	InstrumentID: string
	Offset: string
	Price: number
	Volume: number
}
export type KLine = {
	categoryData: string[]
	values: number[][]
	volumes: number[][]
}
